//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS SSMGuiConnect service.
///
/// AWS Systems Manager GUI Connect Systems Manager GUI Connect, a component of Fleet Manager, lets you connect to your Window Server-type Amazon Elastic Compute Cloud (Amazon EC2) instances using the Remote Desktop Protocol (RDP). GUI Connect, which is powered by Amazon DCV, provides you with secure connectivity to your Windows Server instances directly from the Systems Manager console. You can have up to four simultaneous connections in a single browser window. In the console, GUI Connect is also referred to as Fleet Manager Remote Desktop. This reference is intended to be used with the  Amazon Web Services Systems Manager User Guide . To get started, see the following user guide topics:    Setting up Amazon Web Services Systems Manager     Connect to a Windows Server managed instance using Remote Desktop
public struct SSMGuiConnect: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the SSMGuiConnect client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "SSMGuiConnect",
            serviceIdentifier: "ssm-guiconnect",
            serviceProtocol: .restjson,
            apiVersion: "2021-05-01",
            endpoint: endpoint,
            errorType: SSMGuiConnectErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Deletes the preferences for recording RDP connections.
    @Sendable
    @inlinable
    public func deleteConnectionRecordingPreferences(_ input: DeleteConnectionRecordingPreferencesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteConnectionRecordingPreferencesResponse {
        try await self.client.execute(
            operation: "DeleteConnectionRecordingPreferences", 
            path: "/DeleteConnectionRecordingPreferences", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the preferences for recording RDP connections.
    ///
    /// Parameters:
    ///   - clientToken: User-provided idempotency token.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteConnectionRecordingPreferences(
        clientToken: String? = DeleteConnectionRecordingPreferencesRequest.idempotencyToken(),
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteConnectionRecordingPreferencesResponse {
        let input = DeleteConnectionRecordingPreferencesRequest(
            clientToken: clientToken
        )
        return try await self.deleteConnectionRecordingPreferences(input, logger: logger)
    }

    /// Returns the preferences specified for recording RDP connections in the requesting Amazon Web Services account and Amazon Web Services Region.
    @Sendable
    @inlinable
    public func getConnectionRecordingPreferences(logger: Logger = AWSClient.loggingDisabled) async throws -> GetConnectionRecordingPreferencesResponse {
        try await self.client.execute(
            operation: "GetConnectionRecordingPreferences", 
            path: "/GetConnectionRecordingPreferences", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            logger: logger
        )
    }

    /// Updates the preferences for recording RDP connections.
    @Sendable
    @inlinable
    public func updateConnectionRecordingPreferences(_ input: UpdateConnectionRecordingPreferencesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateConnectionRecordingPreferencesResponse {
        try await self.client.execute(
            operation: "UpdateConnectionRecordingPreferences", 
            path: "/UpdateConnectionRecordingPreferences", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the preferences for recording RDP connections.
    ///
    /// Parameters:
    ///   - clientToken: User-provided idempotency token.
    ///   - connectionRecordingPreferences: The set of preferences used for recording RDP connections in the requesting Amazon Web Services account and Amazon Web Services Region. This includes details such as which S3 bucket recordings are stored in.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateConnectionRecordingPreferences(
        clientToken: String? = UpdateConnectionRecordingPreferencesRequest.idempotencyToken(),
        connectionRecordingPreferences: ConnectionRecordingPreferences,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateConnectionRecordingPreferencesResponse {
        let input = UpdateConnectionRecordingPreferencesRequest(
            clientToken: clientToken, 
            connectionRecordingPreferences: connectionRecordingPreferences
        )
        return try await self.updateConnectionRecordingPreferences(input, logger: logger)
    }
}

extension SSMGuiConnect {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: SSMGuiConnect, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}
